# ---------------------------------------------------------------------------
#
# PSC_BnD_Init.ps1
#
# ---------------------------------------------------------------------------
param ( [switch]$noPSCPrompt , [switch]$ForceDownload )

# -ForceDownload Causes the existing PSC_BnD to be deleted and a new one to be downloaded

# ---------------------------------------------------------------------------

$PSC_BnD_Publication = "\\Hdc.net\thematrix\HSD Published Software\PSC_BuildManagement\"
$PSC_BnD_Directory = ".\"

# ---------------------------------------------------------------------------

# This file initializes parameters for managing environment
. ".\ProjectSettings.ps1"

# The UserSettings file, if it exists, provides for overriding variables from ProjectSettings
if (Test-Path "UserSettings.ps1")
{
	. ".\UserSettings.ps1"
}

# ---------------------------------------------------------------------------
Copy-Item (Join-Path $PSC_BnD_Publication 'Downloader.1.0.ps1') '.\'

. ".\Downloader.1.0.ps1"

. ".\PSC_BnD\Deploy\Install\CommonFunctions\_init.ps1"

# ---------------------------------------------------------------------------

if (-not $ProjectPSC_BnD_Initialized)
{
	$ProjectPSC_BnD_Initialized = $TRUE
	
	$ProjectBuildManagementDir = Get-ScriptDir
	. "$ProjectBuildManagementDir\PSC_BnD\CmdLets\_Init.ps1" $noPSCPrompt
	
	AddTo-Path $ProjectBuildManagementDir
	
	$DefaultDatabaseSchemaDir = Get-FullPath "$ProjectBuildManagementDir/$DefaultDatabaseSchemaDir"
	$DefaultDatabaseConfigFile = Get-FullPath "$ProjectBuildManagementDir/$DefaultDatabaseConfigFile"

}
